//package com.ellison.springdemo.config.thread;
//
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.core.env.Environment;
//
//import java.util.concurrent.*;
//
///**
// * <p>TODO</p>
// *
// * @author Ellison_Pei
// * @date 2022/4/6 17:01
// * @since 1.0
// **/
//@Configuration
//public class CustomThreadPoolExecutor extends ThreadPoolExecutor {
//    @Autowired
//    private static Environment environment;
//
//    public static CustomThreadPoolExecutor getInstance(){
//        return  ThreadHolder.INSTANCE;
//    }
//
//    public static class ThreadHolder{
//        static final CustomThreadPoolExecutor INSTANCE = createInstance();
//        static CustomThreadPoolExecutor createInstance(){
//            CustomThreadPoolExecutor singleton = null;
//            singleton = new CustomThreadPoolExecutor(5, 5, 1000L, TimeUnit.MILLISECONDS,
//                    new ArrayBlockingQueue<>(256), CustomThreadFactory.create("custom-thraad-pool-"), new AbortPolicy());
//            return singleton;
//        }
//    }
//
//    public CustomThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory, RejectedExecutionHandler handler) {
//        super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, threadFactory, handler);
//    }
//}
